package com.whd.strategy.c_okWtite;

/**
 * @author whd
 * @date 2024/07/18 17:39:57
 */
public class Cashback implements Count {
    private Integer cash;
    private Integer back;

    @Override
    public Long sum(Long money, Integer count) {
        long all = money * count;
        return all - back * (all / cash);
    }

    public Cashback(Integer cash, Integer back) {
        this.back = back * 100;
        this.cash = cash * 100;
    }
}
